package com.cx.mapper;

import com.cx.pojo.Critic;
import com.cx.pojo.CriticExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface CriticMapper {
    int countByExample(CriticExample example);

    int deleteByExample(CriticExample example);

    int deleteByPrimaryKey(Integer criticId);

    int insert(Critic record);

    int insertSelective(Critic record);

    List<Critic> selectByExampleWithBLOBs(CriticExample example);

    List<Critic> selectByExample(CriticExample example);

    Critic selectByPrimaryKey(Integer criticId);

    int updateByExampleSelective(@Param("record") Critic record, @Param("example") CriticExample example);

    int updateByExampleWithBLOBs(@Param("record") Critic record, @Param("example") CriticExample example);

    int updateByExample(@Param("record") Critic record, @Param("example") CriticExample example);

    int updateByPrimaryKeySelective(Critic record);

    int updateByPrimaryKeyWithBLOBs(Critic record);

    int updateByPrimaryKey(Critic record);
    //根据文章id搜索且根据赞数排列评论
    List<Critic> selectByPostId(Integer psotId);
    //根据当前用户id来搜寻他的所有评论
    List<Critic> selectByUserId(Integer userId);
}